Simplify the code and respect the show-button-images setting. (#307941,
authorMatthias Clasen <mclasen@redhat.com>
Thu, 16 Jun 2005 16:44:08 +0000 (16:44 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 16 Jun 2005 16:44:08 +0000 (16:44 +0000)
2005-06-16  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkfilechooserdefault.c (button_new): Simplify
the code and respect the show-button-images setting.
(#307941, Vincent Noel)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkfilechooserdefault.c

index 9fb5aca76b717c4ada2fb9afce0e74d525c9b6bc..22eb1eddb6091260721d59ed397e4a8fa4ea8b40 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2005-06-16  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserdefault.c (button_new): Simplify
+       the code and respect the show-button-images setting.
+       (#307941, Vincent Noel)
+
        * gtk/gtkdnd.c: Update the RGBA cursor if an
        icon is set after the cursor has been constructed.
        Also handle repeated setting of icons correctly.
index 9fb5aca76b717c4ada2fb9afce0e74d525c9b6bc..22eb1eddb6091260721d59ed397e4a8fa4ea8b40 100644 (file)
@@ -1,5 +1,9 @@
 2005-06-16  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserdefault.c (button_new): Simplify
+       the code and respect the show-button-images setting.
+       (#307941, Vincent Noel)
+
        * gtk/gtkdnd.c: Update the RGBA cursor if an
        icon is set after the cursor has been constructed.
        Also handle repeated setting of icons correctly.
index 9fb5aca76b717c4ada2fb9afce0e74d525c9b6bc..22eb1eddb6091260721d59ed397e4a8fa4ea8b40 100644 (file)
@@ -1,5 +1,9 @@
 2005-06-16  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserdefault.c (button_new): Simplify
+       the code and respect the show-button-images setting.
+       (#307941, Vincent Noel)
+
        * gtk/gtkdnd.c: Update the RGBA cursor if an
        icon is set after the cursor has been constructed.
        Also handle repeated setting of icons correctly.
index 3b18ef0f01926297534c8221a157c8cfb03b2a17..e22587c50a30543e30e3dc61436618b6300cc46c 100644 (file)
@@ -1874,29 +1874,15 @@ button_new (GtkFileChooserDefault *impl,
            GCallback   callback)
 {
   GtkWidget *button;
-  GtkWidget *hbox;
-  GtkWidget *widget;
-  GtkWidget *align;
-
-  button = gtk_button_new ();
-  hbox = gtk_hbox_new (FALSE, 2);
-  align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+  GtkWidget *image;
 
-  gtk_container_add (GTK_CONTAINER (button), align);
-  gtk_container_add (GTK_CONTAINER (align), hbox);
-  widget = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
-
-  gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
-
-  widget = gtk_label_new_with_mnemonic (text);
-  gtk_label_set_mnemonic_widget (GTK_LABEL (widget), GTK_WIDGET (button));
-  gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+  button = gtk_button_new_with_mnemonic (text);
+  image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
+  gtk_button_set_image (GTK_BUTTON (button), GTK_IMAGE (image));
 
   gtk_widget_set_sensitive (button, sensitive);
   g_signal_connect (button, "clicked", callback, impl);
 
-  gtk_widget_show_all (align);
-
   if (show)
     gtk_widget_show (button);